package test11;

import java.util.function.Function;

/**
 * @Author czl
 * @Date 2024-04-11
 */
public class MainTest {
    public static void main(String[] args) {
        String str = "张三,18";

        Function<String,Student> function = (t) -> {
            String[] arr = t.split(",");
            String name = arr[0];
            int age = Integer.parseInt(arr[1]);
            return new Student(name,age);
            //return new Student(name,age + 1);
        };

        Student student = function.apply(str);
        System.out.println(student);
    }
}
